home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 111 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.7 KB

  1. Path: fido.asd.sgi.com!austern
  2. From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Why no allocator-specific delete?
  5. Date: 23 Jan 1996 10:20:04 PST
  6. Organization: Computer Science, University of Melbourne, Australia
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <9601231054.7277@mulga.cs.mu.OZ.AU>
  9. References: <4dvid8$460@news.bridge.net> <4e0u1s$5fv@engnews1.Eng.Sun.COM> <4e1jfb$1ea@fsgm01.fnal.gov>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. X-Original-Date: Tue, 23 Jan 1996 21:54:33 +1100
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBVAwUBMQUm8Uy4NqrwXLNJAQGXIAH/eMq40vjfymELO5eO9QqXpezCxDUA4Upz
  14.     vzhDedmP0yOAA84lgYZ4HHkidH461Tl3Md208+ZHJKMmdKVHyHs0Xg==
  15.     =IkYj
  16. Originator: austern@isolde.mti.sgi.com
  17.  
  18. b91926@fsgm01.fnal.gov (David Sachs) writes:
  19.  
  20. >One form for placement operator delete, that might avoid ambiguity is:
  21. >
  22. >delete (placement parameters) (pointer)
  23. >
  24. >The extra parentheses around the pointer would make this not a
  25. >syntactically correct non-placement delete.
  26.  
  27. Nope, that won't help.  Consider the following code:
  28.  
  29.     operator delete (void *, void (*)(int *));
  30.     void f(int *);
  31.     int *p;
  32.     // ...
  33.     delete (f) (p);
  34.  
  35. Should this be a call to placement delete, or should
  36. it be equivalent to
  37.  
  38.     delete f(p);
  39.  
  40. ?
  41.  
  42. The ambiguity problems could have been resolved by using a 
  43. syntax such as `delete {placement parameters} pointer'.
  44.  
  45. --
  46. Fergus Henderson                 WWW: http://www.cs.mu.oz.au/~fjh
  47. fjh@cs.mu.oz.au                  PGP: finger fjh@128.250.37.3
  48. ---
  49. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  50.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  51.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  52.